﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Sowrk03_28.Repository.Migrations
{
    public partial class 更改养殖字段名称 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.RenameColumn(
                name: "Variety",
                table: "Farmed",
                newName: "Principal");

            migrationBuilder.RenameColumn(
                name: "TraceableId",
                table: "Farmed",
                newName: "Feeding");

            migrationBuilder.RenameColumn(
                name: "RearingDays",
                table: "Farmed",
                newName: "FarmId");

            migrationBuilder.RenameColumn(
                name: "RearingBy",
                table: "Farmed",
                newName: "Breed");

            migrationBuilder.RenameColumn(
                name: "OutDate",
                table: "Farmed",
                newName: "PublicationDate");

            migrationBuilder.RenameColumn(
                name: "FodderBrand",
                table: "Farmed",
                newName: "Brand");

            migrationBuilder.AddColumn<int>(
                name: "BatchId",
                table: "Farmed",
                type: "int",
                nullable: false,
                defaultValue: 0);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "BatchId",
                table: "Farmed");

            migrationBuilder.RenameColumn(
                name: "PublicationDate",
                table: "Farmed",
                newName: "OutDate");

            migrationBuilder.RenameColumn(
                name: "Principal",
                table: "Farmed",
                newName: "Variety");

            migrationBuilder.RenameColumn(
                name: "Feeding",
                table: "Farmed",
                newName: "TraceableId");

            migrationBuilder.RenameColumn(
                name: "FarmId",
                table: "Farmed",
                newName: "RearingDays");

            migrationBuilder.RenameColumn(
                name: "Breed",
                table: "Farmed",
                newName: "RearingBy");

            migrationBuilder.RenameColumn(
                name: "Brand",
                table: "Farmed",
                newName: "FodderBrand");
        }
    }
}
